package com.mebs.edi.model.edi.e214;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.mebs.edi.model.dom.DomAttribute;
import com.mebs.edi.model.dom.DomEntity;

/**
 * 
 * B10 section of a 214 EDI file 
 * 
 * @author nit
 *
 */
@Embeddable
@DomEntity(name = "B10")
public class Edi214B10 {
	
	@Column(nullable = true, length = 30)
	@DomAttribute
	private String b1001; 		// Reference Identification (Carrier Pro Number(Shipper Account Number))
	
	@Column(nullable = true, length = 30)
	@DomAttribute
	private String b1002; 		// Shipment Identification Number (BOL or other number identifying shipment)
	
	@Column(nullable = true, length = 4)
	@DomAttribute
	private String b1003; 		// Standard Carrier Alpha Code (SCAC like UPSF)
	
	public Edi214B10() {
		super();
	}

	public String getB1001() {
		return b1001;
	}

	public void setB1001(String b1001) {
		this.b1001 = b1001;
	}

	public String getB1002() {
		return b1002;
	}

	public void setB1002(String b1002) {
		this.b1002 = b1002;
	}

	public String getB1003() {
		return b1003;
	}

	public void setB1003(String b1003) {
		this.b1003 = b1003;
	}

	@Override
	public String toString() {
		return "Edi214B10 [b1001=" + b1001 + ", b1002=" + b1002 + ", b1003=" + b1003 + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((b1001 == null) ? 0 : b1001.hashCode());
		result = prime * result + ((b1002 == null) ? 0 : b1002.hashCode());
		result = prime * result + ((b1003 == null) ? 0 : b1003.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edi214B10 other = (Edi214B10) obj;
		if (b1001 == null) {
			if (other.b1001 != null)
				return false;
		} else if (!b1001.equals(other.b1001))
			return false;
		if (b1002 == null) {
			if (other.b1002 != null)
				return false;
		} else if (!b1002.equals(other.b1002))
			return false;
		if (b1003 == null) {
			if (other.b1003 != null)
				return false;
		} else if (!b1003.equals(other.b1003))
			return false;
		return true;
	}

}
